
<%@ page import="java.util.List" %>
<%@ page import="com.luntan.school.dao.CategoryDao" %>
<%@ page import="com.luntan.school.dao.impl.CategoryDaolmpl" %>
<%@ page import="com.luntan.school.model.Category" %><%--
  Created by IntelliJ IDEA.
  User: chimei666
  Date: 2023/12/25
  Time: 14:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String categoryId = request.getParameter("category");
%>
<%
    CategoryDao categoryDao = new CategoryDaolmpl();
    List<Category> categories = categoryDao.getAllCategories();
%>
<li <%if(categoryId==null){%>class="active"<%}%>><a href="login.jsp">首页</a></li>
<%for (Category category : categories) {%>
<li <%if(categoryId!=null && category.getId()==Integer.valueOf(categoryId)){%>class="active"<%}%>><a
        href="login.jsp?category=<%=category.getId()%>"><%=category.getName()%>
</a></li>
<%}%>

